package designpatterns.visitor;

import org.junit.Test;

/**
 * @author LiDong
 * @version 1.0.0
 * @createTime 2/17/2022 8:00 PM
 */
public class AppTest {


    @Test
    public void test() {
        ObjectStructure os = new ObjectStructure();
        os.add(new ConcreteElementA());
        os.add(new ConcreteElementB());
        Visitor visitor = new ConcreteVisitorA();
        os.accept(visitor);
        System.out.println("------------------------");
        visitor = new ConcreteVisitorB();
        os.accept(visitor);
    }

}
